package com.bing.task.v1;

import com.bing.entity.Account;
import com.bing.entity.Answer;
import com.bing.entity.Question;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

/**
 * Created by kaibb on 15-11-23.
 */
public class QuestionResult {
    private Set<Account> accounts;
    private List<Answer> answers;
    private List<Question> questions;

    public QuestionResult() {
        accounts = new HashSet<Account>();
        answers = new ArrayList<Answer>();
        questions = new ArrayList<Question>();
    }

    public void addAccounts(Set<Account> accounts) {
        this.accounts.addAll(accounts);
    }

    public QuestionResult addQuestionResult(QuestionResult questionResult) {
        this.addAccounts(questionResult.getAccounts());
        this.addQuestions(questionResult.getQuestions());
        this.addAnswers(questionResult.getAnswers());
        return this;
    }

    public void addAnswers(List<Answer> answers) {
        this.answers.addAll(answers);
    }

    public void addQuestions(List<Question> questions) {
        this.questions.addAll(questions);
    }

    public Set<Account> getAccounts() {
        return accounts;
    }

    public void setAccounts(Set<Account> accounts) {
        this.accounts = accounts;
    }

    public List<Answer> getAnswers() {
        return answers;
    }

    public void setAnswers(List<Answer> answers) {
        this.answers = answers;
    }

    public List<Question> getQuestions() {
        return questions;
    }

    public void setQuestions(List<Question> questions) {
        this.questions = questions;
    }
}
